#include <map>

#include <windows.h>

#define USE_ACE_AGENT_API_PROTOTYPES
#include "acexport.h"

#pragma once

#include "AceSession.h"

namespace ace
{
  class CAceEnvironment : public auth::IAuthEnvironment
  {
  public:
    CAceEnvironment();
    virtual ~CAceEnvironment();

    void clear() const;
  private:
    typedef std::map<SDI_HANDLE, IAceSession *> CSessionMap;

    static CSessionMap s_sessions;

    static void WINAPI destroySession(SDI_HANDLE handle);  
  public:
    virtual auth::IAuthSession *createSession();

    void registerSession(IAceSession *pSession);
    void unregisterSession(IAceSession *pSession);    
  };
} // namespace ace